﻿Imports System.Data.OleDb
Public Class DataProvider
    Public Shared _ConnectString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=0865059_0865125_QuanLiHocSinh.mdb;User Id=admin;Password=;"
    Public Shared Function ConnectDB() As OleDbConnection
        Dim conn As OleDbConnection = New OleDbConnection()
        conn.ConnectionString = _ConnectString
        conn.Open()
        Return conn
    End Function
    Public Shared Function DocBang(ByVal strSQL As String) As DataTable
        Dim dt As New DataTable()
        'tao ket noi
        Dim cn As OleDbConnection = DataProvider.ConnectDB()
        Dim da As OleDbDataAdapter = New OleDbDataAdapter(strSQL, cn)
        da.Fill(dt)
        cn.Close()
        Return dt
    End Function
End Class
